import request from '@/utils/request'


//新闻创建数据
export function newsCreate(data) {
    return request({
      url: '/news/create',
      method: 'post',
      data:data
    })
  }
//新闻通过id修改数据
export function newsUpdate(id,data) {
    return request({
      url: '/news/update/'+id,
      method: 'put',
      data:data
    })
  }
//删除多个多条数据(传递字符串)
export function newsRemoves(data) {
    return request({
      url: '/news/removes',
      method: 'delete',
      data:{ids:data.toString()}
    })
  }
//删除单条数据
export function newsDelete(id) {
    return request({
      url: '/news/delete/'+id,
      method: 'delete'
    })
  }
//获取传递过来的id的数据
export function newsListId(id) {
    return request({
      url: '/news/list/'+id,
      method: 'get'
    })
  }
//获取有页码字段的所有数据
export function newsListPage(data) {
    return request({
      url: '/news/list',
      method: 'post',
      data:data
    })
  }
//获取所有--没有页码数据
export function newsList() {
    return request({
      url: '/news/lm',
      method: 'post'
    })
  }
